home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / nt / ntwhich.zip / NTWHICH.TXT < prev   
Text File  |  1994-07-24  |  2KB  |  64 lines

  1. /* ntwhich.txt ... find first matching executable in path
  2.  * Copyright (C) 1994 by
  3.  * jack j. woehr, p.o. box 51, golden, colorado 80402-0051
  4.  * jax@well.sf.ca.us JAX on GEnie 72203.1320@compuserve.com
  5.  * SYSOP, RealTime Control & Forth Board [RCFB] (303) 278-0364
  6.  * All Rights Reserved
  7.  */
  8.  
  9. /*
  10.  * This is free software and can be modified and redistributed under
  11.  * certain conditions described in the file COPYING.TXT. The
  12.  * Disclaimer of Warranty and License for this free software are also
  13.  * contained in the file COPYING.TXT.
  14.  */
  15.  
  16. Usage:
  17.  
  18.     NTWHICH <-l | -L | /l | /L | -h | -H | /H | /?> [filename, filename, filename, ...]
  19.  
  20. Synopsis:
  21.  
  22.     The -l option gives the license. The -h option gives help, as
  23. does the /? option.
  24.  
  25.     NTWHICH searches the path for the first occurence in the path of
  26. an executable consisting of 'filename' plus one of the four command-
  27. line-executable extensions, .COM, .EXE, .BAT or .CMD
  28.  
  29.     The order in which NT will execute files of the same name with
  30. different extensions when found in the same directory is as follows:
  31.  
  32.     1) .COM
  33.     2) .EXE
  34.     3) .BAT
  35.     4) .CMD
  36.  
  37.     Therefore, when searching the path, the first occurrence of a
  38. pair of identical filenames with different extensions is resolved in the
  39. same manner by NTWHICH, e.g., if FOO.COM and FOO.EXE are in the same
  40. directory c:\blah\woof as found in the path,
  41.  
  42.     C:\>NTWHICH foo
  43.  
  44. will report as follows:
  45.  
  46.     FOO:
  47.         c:\blah\woof\foo.COM
  48.  
  49.     NTWHICH accepts multiple filenames. If any filename has an
  50. extension on it, e.g., FOO.ARF, that specific file will be sought, but
  51. again, only in the path.
  52.  
  53.     NOTE: As CMD.EXE has an implicit first element of ".\" (the
  54. current directory) since 'way back in the MSDOS days, NTWHICH treats the
  55. matter the same way: the current directory is searched first.
  56.  
  57. Bugs:
  58.     PATH is limited to about 16K characters. The combined filename
  59. and any single path element is limited to about 4k characters. This
  60. should probably be enough.
  61.  
  62. <<END>>
  63.  
  64.